package tech.aistar.day08.equal;

/**
 * 本类用来演示:
 *
 * @author: success
 * @date: 2021/3/17 2:46 下午
 */
public class BookInfo {
    private int id;

    private String remark;

    public BookInfo() {
    }

    public BookInfo(int id, String remark) {
        this.id = id;
        this.remark = remark;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        BookInfo info = (BookInfo) o;

        return id == info.id;
    }

    @Override
    public int hashCode() {
        return id;
    }

    @Override
    public String toString() {
        return "BookInfo{" +
                "id=" + id +
                ", remark='" + remark + '\'' +
                '}';
    }
}
